<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		/*

			面向过程
				吃狗屎


			面向对象
				狗吃屎

			var obj = {};
		*/

		var Car = new Object();
		Car.name = "宝马";
		Car.speed = 0;
		Car.color = "黑色";
		Car.addSpeed = function(num){
			Car.speed += num;
			alert("车开动了，速度是"+Car.speed);
		}
		Car.stop = function(){
			Car.speed = 0;
			alert('车停了');
		}

		alert("我有一辆车,车的牌子是"+Car.name);
		alert("我开出去了，提速，提升的速度是50");
		Car.addSpeed(50);
		alert("开的太快了，我停车");
		Car.stop();


	</script>
</body>
</html>